<?php

	/* SVN FILE: $Id: index.php 43 2011-01-16 22:16:50Z andreoletti $ */
	
	/**
	 * Project Name : arcadia
	 *
	 * @author $Author: andreoletti $
	 * @version $Revision: 43 $
	 * @lastrevision $Date: 2011-01-16 23:16:50 +0100 (dom, 16 gen 2011) $
	 * @filesource $URL: http://svn.fletchlynd.com/arcadia/trunk/visioni/index.php $
	 */
	 
	require_once 'include/functions.php';
	require_once 'include/const.inc.php';
	require_once '../include/auth.inc.php';
	require_once '../include/conn.inc.php';

	require_once('../include/table.php');

	$sHeadContent .= fnHeadContent($sTable);

	require_once('../themes/'.$sTHEME.'/template.php');
	die();
	
	function fnHeadContent($sTable) {
	
		global $sSUITE_NAME;
		global $sAPP;
		
		global $sJsVariables;
		global $sJsDocumentReady;
		global $sDrawCallback;
		global $sColumnDefs;
		global $sSorting;
		global $iDisplayLength;
		global $iDisplayStart;
		global $sAoDataPush;
		
		$sHeadContent = <<<EOT

		<script type="text/javascript">
		
		$(document).ready(function(){
			
			$sJsVariables
			
			$sJsDocumentReady
			
			var oTable = $("#main-table").dataTable( {
				"sDom": 'rt<"dt_info"ip><"dt_length"l>',
				"oLanguage": { "sUrl": "../include/dataTables/it_IT.txt" },		
				"aoColumnDefs": [ $sColumnDefs ],
				"bAutoWidth": false,
				"aaSorting": $sSorting,
				"iDisplayLength": $iDisplayLength,
				"iDisplayStart": $iDisplayStart,
				"bStateSave": false,
				"sPaginationType": "full_numbers",
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": "./json.php",
				"fnServerData": function ( sSource, aoData, fnCallback ) {
					/* Add some extra data to the sender */
					aoData.push( 	$sAoDataPush
									{ "name": "sWhat", "value": 'main-table' },
									{ "name": "sTable", "value": "$sTable" } );
					$.getJSON( sSource, aoData, function (json) { 
						/* Do whatever additional processing you want on the callback, then tell DataTables */
						fnCallback(json)
					} );
				},
				"fnDrawCallback": function() {
					
					$sDrawCallback
					
					$('.tooltip', oTable.fnGetNodes()).cluetip({
				    	showTitle: false,
				      	cluetipClass: 'jtip', 
				      	arrows: true, 
				      	dropShadow: false
					});
					
					$(".prettydate").prettyDate();	
				}
			});			
		});
	</script>
EOT;

	return $sHeadContent;

	}
?>